<?php
/**
 * Nweb Framework
 *
 * This script is protected by copyright. It's use, copying, modification
 * and distribution without written consent of the author is prohibited.
 *
 * @category    source
 * @package     pl.nweb.framework.http
 * @subpackage  client
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @license     http://www.gnu.org/licenses/lgpl-3.0.txt  GNU Lesser General Public
 * @version     3.0 $Id: exception.php 452 2011-12-07 12:04:19Z krzysztof.kardasz $
 * @link        http://code.google.com/p/nweb-framework/
 * @link        http://framework.nweb.pl
 */

namespace pl\nweb\framework\http\client\adapter;

/**
 * Wyjątek klienta
 *
 * @category    source
 * @package     pl.nweb.framework.http
 * @subpackage  client
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @version     3.0 $Id: exception.php 452 2011-12-07 12:04:19Z krzysztof.kardasz $
 */
class Exception extends \pl\nweb\framework\http\Exception
{
    /**
     * Obiekt adaptera
     *
     * @var \pl\nweb\framework\http\client\Adapter
     */
    private $_adapter = null;

    /**
     * Konstruktor
     *
     * @param string $message wiadomość
     * @param integer $code kod błędu
     * @param \pl\nweb\framework\http\client\Adapter $adapter obiekt adaptera
     * @param null|\Exception $previous obiekt poprzedniego wyjątka
     */
    public function __construct($message, $code, \pl\nweb\framework\http\client\Adapter $adapter, $previous = null)
    {
        parent::__construct($message, $code, $previous);
        $this->_adapter = $adapter;
    }

    /**
     * Zwraca obiekt adaptera
     *
     * @return \pl\nweb\framework\http\client\Adapter
     */
    public function getAdapter()
    {
        return $this->_adapter;
    }
}